var ClubMsgManager = cc.Class.extend({
    isCreate:false,
    loginReqeust: false,

    //在这个Object中的方法 都只有首次请求，后续都是利用缓存中的数据。依赖服务器的推送来刷新数据
    _clubCacheCode: {
        'QueryClubList': false,
        'ClubBaseInfo': {},
        'AllMemberInfo': {},
        'ListClubRoom': {},
        'QueryWanfas': {},
        'QueryClubGroup': {},
    },

    //不同的玩家 不同的亲友圈数据缓存
    //因为目前是本地缓存数据，如果要切换账号的话 需要不同的账号存储不同的数据
    _playerId2ClubCacheCode: {},
    /**
     * 锁定亲友圈缓存
     * 每次存储缓存之前锁定
     * 确定缓存到当前玩家账号上
     *
     */
    lockClubCodeCache: function () {
        if (!this._playerId2ClubCacheCode[gameData.uid]) {
            this._playerId2ClubCacheCode[gameData.uid] = {
                'QueryClubList': false,
                'ClubBaseInfo': {},
                'AllMemberInfo': {},
                'ListClubRoom': {},
                'QueryWanfas': {},
                'QueryClubGroup': {},
            };
        }
        this._clubCacheCode = this._playerId2ClubCacheCode[gameData.uid];
    },

    ctor: function () {
        eventManager.addListener('Msg_Net_2103', this._clubMsgHandelr, this);
        eventManager.addListener('Msg_Net_40001', this._clubRecordHandelr, this);
        eventManager.addListener('Msg_Net_2001', this._loginHandler, this);
        cc.eventManager.addCustomListener(cc.game.EVENT_SHOW, this._gameOnShow.bind(this));

        ClubViewUtil.cacheClub();
    },

    _loginHandler: function (data) {
        gameData.uid = data.uid;
        clubMsgManager.loginRequest();
    },

    _clubRecordHandelr: function (data) {
        if (data && data['cmd']) {
            var cmd = data['cmd'];
            if (cmd == ClubRecordCode.ClubRecordMarked) {
                eventManager.dispatchEvent(cmd, data['room_rid']);
            } else if (cmd == ClubRecordCode.RankingsList || cmd == ClubRecordCode.DataOverview || cmd == ClubRecordCode.UserCoefficient || cmd == ClubRecordCode.UserChangCi) {
                eventManager.dispatchEvent(cmd, (data['data'] || []));
            } else if (cmd == ClubRecordCode.RecordDetail) {
                eventManager.dispatchEvent(cmd, data['roomInfo']);
            } else if (cmd == ClubRecordCode.CardNum) {
                eventManager.dispatchEvent(cmd, data['numof_cards_2']);
            } else if (cmd == ClubRecordCode.GetReCordUserData) {
                eventManager.dispatchEvent(cmd, data['data']);
            } else if (cmd == ClubRecordCode.ClubMyRecord) {
                eventManager.dispatchEvent(cmd, data);
            } else if (cmd == ClubRecordCode.GetGroupData) {
                eventManager.dispatchEvent(cmd, data['data']);
            } else {
                eventManager.dispatchEvent(cmd, data['roomrs']);
            }
        }
    },
    _gameOnShow: function () {
        if (!cc.sys.isNative) {
            return;
        }
        clubMsgManager.loginRequest();
    },

    _clubMsgHandelr: function (data) {
        if (!data || ClubMsgManager.isCreate) {
            cc.error('俱乐部操作数据为空');
            return;
        }
        // clubMsgManager.lockClubCodeCache();
        ClubDataManager.lockClubDataCache();
        var cmd = data['command'];
        if (cmd == ClubMsgCode.BroadcastUid) {
            var message = data['data'];
            if (message) {
                var type = message['type'] || '';
                if (type == MessageType.Invite) {
                    message.from_uid = data['from_uid'];
                    message.club_id = data['club_id'];
                    if (message['uids'].toString().indexOf(gameData.uid) >= 0) {
                        showWindow('ClubRoomInviteMemberWindow', message)
                    }
                } else if (type == MessageType.Refused) {
                    showAlert(message['msg']);
                }
            }
        } else if (data['result'] < 0) {
            // ListClubRoom命令可能会收到 msg:没有房间 这个属于正常情况 新亲友圈就是没忽悠房间列表
            if (cmd == ClubMsgCode.ListClubRoom && data['msg'] == '没有房间') {

            } else {
                showAlert(data['msg']);
                return;
            }
        }
        var clubId = data['club_id'];
        if (cmd == ClubMsgCode.QueryClubList) {
            ClubDataManager.refreshClubList(data['arr']);
            if (clubMsgManager.loginReqeust) {
                clubMsgManager.loginRequestClubInfo();
            }
        }
        if (cmd == ClubMsgCode.ClubBaseInfo) {
            ClubDataManager.refreshClubData(clubId, data['info']);
            eventManager.dispatchEvent(ClubEvent.ClubBaseInfo, clubId);
        }

        if (cmd == ClubMsgCode.DeleteClub && data['result'] == 0 && data['msg'] == "删除俱乐部成功") {
            ClubDataManager.DelectClubDataList(data['club_id']);
            //存储当前选择的亲友圈Id  用于下次点开亲友圈时  上次选中的亲友圈放在第一位
            cc.sys.localStorage.setItem(ClubLastInfo, 0);
        }
        if (cmd == ClubMsgCode.LeaveClub && data['result'] == 0 && data['msg'] == "移除成员成功") {
            ClubDataManager.DelectClubDataList(data['club_id']);
            cc.sys.localStorage.setItem(ClubLastInfo, 0);
        }

        if (cmd == ClubMsgCode.ListClubRoom) {
            ClubDataManager.clubListRoomRefresh(clubId, data['arr']);
        }
        if (cmd == ClubMsgCode.AllMemberInfo) {
            if (cmd == ClubMsgCode.AllMemberInfo) eventManager.dispatchEvent(ClubEvent.AllMemberInfo, data['info']['member']);
            ClubDataManager.clubMembersRefresh(clubId, data['info']['member']);
            if (clubMsgManager.loginReqeust) {
                clubMsgManager.loginReqeustMemberOffLine(clubId);
            }
        }

        if (cmd == ClubMsgCode.OnlineMember) {
            ClubDataManager.clubMembersOnLine(clubId, data['info']['inroom'], data['info']['online'], data['info']['off_line']);
        }

        if (cmd == ClubMsgCode.BlackListDel || cmd == ClubMsgCode.BlackListAdd) {
            var clubInfo = ClubDataManager.getClubData(clubId);
            clubInfo['black_list'] = data['info']['black_list'];
            ClubDataManager.refreshClubData(clubId, clubInfo);
            ClubDataManager.clubMembersStateRefresh(clubId);
        }
        if (cmd == ClubMsgCode.RemoveClubMember && data['result'] == 0) {
            var members = data['info']['member'];
            var isHave = false;
            for (var i = 0; i < members.length; i++) {
                if (members[i].u == gameData.uid) {
                    isHave = true;
                    break;
                }
            }
            ClubDataManager.clubMembersRefresh(clubId, data['info']['member']);
            if (!isHave) {
                ClubDataManager.DelectClubDataList(data['club_id']);
            }
        }

        if (cmd == ClubMsgCode.SetAdmin || cmd == ClubMsgCode.UnsetAdmin) {
            var clubInfo = ClubDataManager.getClubData(clubId);
            clubInfo['admins'] = data['info']['admins'];
            ClubDataManager.refreshClubData(clubId, clubInfo);
            ClubDataManager.clubMembersStateRefresh(clubId);
        }
        if (cmd == ClubMsgCode.QueryClubGroup || cmd == ClubMsgCode.AddmodifyClubGroup || cmd == ClubMsgCode.AddClubGroupUids || cmd == ClubMsgCode.AddClubGroup || cmd == ClubMsgCode.DelClubGroup) {
            var groups = data.info['groups']['groups'] || data.info['groups'];
            if (cmd == ClubMsgCode.AddClubGroupUids) eventManager.dispatchEvent(ClubEvent.AddClubGroupUids, groups);
            if (cmd == ClubMsgCode.QueryClubGroup) eventManager.dispatchEvent(ClubEvent.QueryClubGroup, groups);
            ClubDataManager.clubGroupsRefresh(clubId, groups);
        }
        if (cmd == ClubMsgCode.SetHours) {
            var clubInfo = ClubDataManager.getClubData(clubId);
            clubInfo['openingtime'] = data['info']['openingtime'];
            clubInfo['start'] = data['info']['start'];
            clubInfo['end'] = data['info']['end'];
            ClubDataManager.refreshClubData(clubId, clubInfo);
        }
        if (cmd == ClubMsgCode.ModifyClub) {
            var clubInfo = ClubDataManager.getClubData(clubId);
            var clubName = data['info']['modifyName'];
            var clubNotice = data['info']['modifyNotice'];
            if (clubName != '' && clubName.length > 0) {
                clubInfo.name = clubName;
            }
            if (clubNotice != '' && clubNotice.length > 0) {
                clubInfo.notice = clubNotice;
            }
            ClubDataManager.refreshClubData(clubId, clubInfo);
            eventManager.dispatchEvent(ClubEvent.ClubBaseInfo, clubId);
        }


        if (cmd == ClubMsgCode.ApplyClub) {
            showAlert(data['msg']);
        }
        if (cmd == ClubMsgCode.InviteClub) {
            showAlert(data['msg'] || '邀请成功!');
        }
        if (ClubDataManager.RooomReturnClubId) {
            ClubViewUtil.showClubMainWindow(ClubDataManager.RooomReturnClubId);
            ClubDataManager.RooomReturnClubId = null;
        }
        eventManager.dispatchEvent(cmd, data);
    },


    /**
     * 请求亲友圈列表
     * @param force 是否强制请求信息
     * @public
     */
    requestClubList: function (force) {
        var clubList = ClubDataManager.getAllClubData();
        if (!force && clubList.length > 0 && this._clubCacheCode['QueryClubList']) {
            cc.warn('已有缓存----不在请求QueryClubList');
            eventManager.dispatchEvent(ClubMsgCode.QueryClubList, {});
            return;
        }
        this._clubCacheCode['QueryClubList'] = true;
        network.send(2103, {cmd: ClubMsgCode.QueryClubList});
    },

    /**
     * 请求在线成员列表
     * @param clubId
     */
    requestOnLineMember: function (clubId) {
        network.send(2103, {cmd: ClubMsgCode.OnlineMember, club_id: clubId});

    },

    /**
     * 请求亲友圈详细信息
     * @param clubId
     * @param force  是否强制请求信息
     */
    requestClubBaseInfo: function (clubId, force) {
        var clubInfo = ClubDataManager.getClubData(clubId);
        if (!force && clubInfo && this._clubCacheCode['ClubBaseInfo'][clubId]) {
            cc.warn('已有缓存----不在请求ClubBaseInfo');
            eventManager.dispatchEvent(ClubMsgCode.ClubBaseInfo, {});
            eventManager.dispatchEvent(ClubEvent.ClubBaseInfo, clubId);
            return;
        }
        // this._clubCacheCode['ClubBaseInfo'][clubId] = true;
        network.send(2103, {cmd: ClubMsgCode.ClubBaseInfo, club_id: clubId});
    },

    /**
     * 请求亲友圈成员信息
     * @param clubId
     * @param force  是否强制请求信息
     */
    requestClubMember: function (clubId, force) {
        var clubInfo = ClubDataManager.getClubData(clubId);
        if (!force && clubInfo && this._clubCacheCode['AllMemberInfo'][clubId]) {
            cc.warn('已有缓存----不在请求AllMemberInfo');
            eventManager.dispatchEvent(ClubMsgCode.AllMemberInfo, {});
            return;
        }
        // this._clubCacheCode['AllMemberInfo'][clubId] = true;
        network.send(2103, {cmd: ClubMsgCode.AllMemberInfo, club_id: clubId, op: 2});
    },

    /**
     * 请求亲友圈成员信息
     * @param clubId
     * @param force  是否强制请求信息
     */
    requestGroups: function (clubId, force) {
        var clubInfo = ClubDataManager.getClubData(clubId);
        if (!force && clubInfo && this._clubCacheCode['QueryClubGroup'][clubId]) {
            cc.warn('已有缓存----不在请求QueryClubGroup');
            eventManager.dispatchEvent(ClubMsgCode.QueryClubGroup, {});
            return;
        }
        this._clubCacheCode['QueryClubGroup'][clubId] = true;
        network.send(2103, {cmd: ClubMsgCode.QueryClubGroup, club_id: clubId});
    },

    /**
     * 请求指定亲友圈房间信息
     * @param clubId
     * @param skip   跳过几个数据 0
     * @param limit  请求几个数据 12
     * @param pos    楼层
     * @param force
     */
    requestListClubRoom: function (clubId, skip, limit, pos, force) {
        var clubInfo = ClubDataManager.getClubData(clubId);
        if (!force && clubInfo && this._clubCacheCode['ListClubRoom'][clubId]) {
            cc.warn('已有缓存----不在请求ListClubRoom');
            eventManager.dispatchEvent(ClubMsgCode.ListClubRoom, {});
            return;
        }
        // this._clubCacheCode['ListClubRoom'][clubId] = true;
        pos = pos == undefined ? 0 : pos;
        // network.send(2103, {cmd: ClubMsgCode.ListClubRoom, club_id: clubId, skip: skip, limit: limit, pos: pos});
        network.send(2103, {cmd: ClubMsgCode.ListClubRoom, club_id: clubId, skip: 0, limit: 50, pos: pos});
    },

    /**
     * 请求指定亲友圈玩法信息
     * @param clubId
     * @param force  是否强制请求信息
     */
    requestClubWanFa: function (clubId, force) {
        var clubInfo = ClubDataManager.getClubData(clubId);
        var wanfas = clubInfo.wanfas;
        if (!force && wanfas && this._clubCacheCode['QueryWanfas'][clubId]) {
            var data = {};
            data['info'] = {};
            data['info']['wanfas'] = wanfas;
            data['result'] = 0;
            cc.warn('已有缓存----不在请求 ClubWanFa');
            eventManager.dispatchEvent(ClubMsgCode.QueryWanfas, data);
            return;
        }
        this._clubCacheCode['QueryWanfas'][clubId] = true;
        network.send(2103, {cmd: ClubMsgCode.QueryWanfas, club_id: clubId});
    },

    /**
     * 请求亲友圈消息
     * @param 进入大厅 带clubid参数
     */
    requestClubMsg: function (clubid) {
        if (clubid){
            network.send(2103, {cmd: ClubMsgCode.QueryMSG, club_id:clubid});
        }
        else {
            network.send(2103, {cmd: ClubMsgCode.QueryMSG});
        }
    },

    /**
     * 发送加入房间请求
     * @param roomId  房间ID
     */
    requestJoinRoom: function (roomId) {
        showLoading('正在加入房间');
        network.send(3002, {room_id: '' + roomId});
    },

    /**
     *  发送快速加入房间
     * @param clubId    亲友圈ID
     * @param floor     快速加入的楼层
     * @param playerNum 快速加入几人房
     */
    requestQuickJoinRoom: function (clubId, floor, playerNum) {
        var roomList = ClubDataManager.getClubFloorRomList(clubId, floor);
        var currentRoomNum = 0;
        var joinRoomId = null;
        var i = 0;
        //循环当前楼层所有房间列表
        for (i = 0; i < roomList.length; i++) {
            if (playerNum != undefined && roomList[i].max_player_cnt != playerNum) {
                continue;
            }
            //查找 当前桌内人数距离开具人数最接近的桌子
            if (roomList[i].cur_player_cnt > currentRoomNum && roomList[i].cur_player_cnt < roomList[i].max_player_cnt) {
                joinRoomId = roomList[i].room_id;
                currentRoomNum = roomList[i].cur_player_cnt;
                //如果当前桌子的人数 +1 刚好符合 桌子的最大人数。则直接加入该桌子 不在查找
                if (currentRoomNum + 1 == roomList[i].max_player_cnt) {
                    break;
                }
            }
        }
        if (joinRoomId) {
            clubMsgManager.requestJoinRoom(joinRoomId);
            return;
        }
        var wanfasInfo = ClubDataManager.getClubFloorWanfaInfo(clubId, floor);
        var wanfaRoomList = ClubDataManager.getWanfaFormatRoomList(wanfasInfo);
        for (var i = 0; i < wanfaRoomList.length; i++) {
            if (playerNum != undefined && wanfaRoomList[i].maxPlayerNum != playerNum) {
                continue;
            }
            clubMsgManager.requestCreateRoom(wanfaRoomList[i]);
            break;
        }
    },

    /**
     * 发送创建房间请求
     * @param wanfaInfo 玩法信息
     */
    requestCreateRoom: function (wanfaInfo) {
        var options = wanfaInfo.options;
        if (_.isString(options)) {
            options = JSON.parse(options);
        }
        var dataPos = wanfaInfo.pos; //桌子的 楼层
        if (dataPos == undefined) {
            return;
        }
        var desc = wanfaInfo.desc + ',' + wanfaInfo.maxPlayerNum + '人玩';
        var clubInfo = ClubDataManager.getClubData(options['club_id']);
        if (clubInfo && clubInfo['param'] && clubInfo['param']['disBandSetting']) {
            var arr = clubInfo['param']['disBandSetting'].split(',');
            options.VoteType = parseInt(arr[0]);
            options.VoteTm = parseInt(arr[1]);
            options.DiscardUnStart = parseInt(arr[2] || 9999999);
        }
        if (clubInfo && clubInfo['param'] && clubInfo['param']['uniqueRoom'] && clubInfo['param']['uniqueRoom'] == 'open') {
            options.uniqueRoom = true;
        }

        options.pos = dataPos;
        options.desp = desc;
        options.wanfadesc = desc;
        options.maxPlayerNum = wanfaInfo.maxPlayerNum;
        options['remarks'] = wanfaInfo['remarks'];
        showLoading('正在加入房间');
        gameData.last3001Data = {
            room_id: 0
            , club_id: options['club_id']
            , club_info: {club_name: clubInfo['name'], club_head: clubInfo['head']}
            , map_id: options['mapid']//gameData.appId
            , mapid: options['mapid']
            , daikai: false
            , options: options
            , timestamp: getCurTimestampMills()
        };
        network.send(3001, gameData.last3001Data);
        // SubUpdateUtil.cacheRoomScene(options['mapid']);
    },

    /**
     * 发送退出房间消息
     */
    requestQuitRoom: function (content) {
        if (gameData.mapId < 300) {
            showMessageBox(content, function () {
                network.send(3003, {room_id: gameData.roomId, leaveOnly: true});
            });
        } else {
            showMessageBox(content, function () {
                network.sendPhz(3003, 'Quit/' + gameData.roomId);
            });
        }
    },

    /**
     * 请求我的战绩
     * @param clubId      亲友圈ID
     * @param mapIds      玩法ID数组[],
     * @param playerId    查询的玩家ID
     * @param date_from   查询的开始时间
     * @param date_to     查询的结束时间
     * @param win         0全部 1大赢家
     * @param page        页数
     */
    requestMyRecord: function (clubId, mapIds, playerId, date_from, date_to, win, page) {
        network.send(40001, {
            cmd: ClubRecordCode.ClubMyRecord,
            area: app.area,
            map_id: mapIds,
            player_id: playerId,
            club_id: clubId,
            date_from: date_from,
            date_to: date_to,
            page: page,
            win: win,
            num: ClubDataManager.RequestRecordMax,
            pos: 0,
        });
    },

    /**
     * 查询亲友圈战绩
     * @param clubId     亲友圈ID
     * @param mapIds     玩法ID[]
     * @param playerId   搜索的玩家ID
     * @param date_from  开始时间
     * @param date_to    结束时间
     * @param marked     是否被标记 0未标记 1标记 2全部
     * @param win        0全部 1大赢家
     * @param socre      我的该房间积分
     * @param page       页数
     */
    requestClubRecord: function (clubId, mapIds, playerId, date_from, date_to, marked, win, socre, page) {
        network.send(40001, {
            cmd: ClubRecordCode.ClubRecord,
            area: app.area,
            map_id: mapIds,
            club_id: clubId,
            player_id: playerId,
            marked: marked,
            date_from: date_from,
            date_to: date_to,
            win: win,
            score: socre,
            page: page,
            num: ClubDataManager.RequestRecordMax,
            pos: 0
        });
    },

    /**
     * 标记亲友圈战绩
     * @param clubId
     * @param agent_id
     * @param mapIds
     * @param playerId
     * @param roomId
     * @param time_end
     */
    requestMarkedReocrd: function (clubId, agent_id, mapIds, playerId, roomId, time_end) {
        network.send(40001, {
            cmd: ClubRecordCode.ClubRecordMarked,
            area: app.area,
            agent_id: agent_id,
            map_id: mapIds,
            club_id: clubId,
            player_id: playerId,
            room_rid: roomId,
            time_end: time_end,
        });
    },

    /**
     * 请求 亲友圈排行榜
     * @param clubId
     * @param mapIds      玩法列表
     * @param timeType    日期类型: today:今天 yesterday:昨天 week:本周
     * @param startDate   查询开始时间
     * @param endDate     查询结束时间
     * @param orderByType 查询类型 winnerCount:大赢家   totalScore:积分  roomCount:局数
     * @param playerId
     * @param win
     */
    requestRanking: function (clubId, mapIds, timeType, startDate, endDate, orderByType, playerId, win) {
        network.send(40001, {
            cmd: ClubRecordCode.RankingsList,
            area: app.area,
            clubId: clubId,
            mapids: mapIds,
            timeType: timeType,
            startDate: startDate,
            endDate: endDate,
            orderByType: orderByType,
            win: win,
            playerId: playerId,
        });
    },

    /**
     * 请求数据概况
     * @param clubId
     * @param pos        楼层
     * @param players    分组uid列表
     * @param startDate  起始时间
     * @param endDate    结束时间
     * @param mapids     玩法数组ID
     * @param score
     * @param win
     * @param playerId
     */
    requestDataOverview: function (clubId, pos, players, startDate, endDate, mapids, score, win, playerId) {
        network.send(40001, {
            cmd: ClubRecordCode.DataOverview,
            area: app.area,
            clubId: clubId,
            pos: pos,
            players: players,
            startDate: startDate,
            endDate: endDate,
            mapids: mapids,
            scores: score,
            win: win,
            playerId: playerId,
        });


    },

    /***
     * 请求用户系数
     * @param clubId
     * @param players
     * @param startDate
     * @param endDate
     * @param mapids
     * @param score
     * @param pos
     * @param playerId
     */
    requestUserCoefficient: function (clubId, players, startDate, endDate, mapids, score, pos, playerId) {
        network.send(40001, {
            cmd: ClubRecordCode.UserCoefficient,
            clubId: clubId,
            area: app.area,
            players: players,
            startDate: startDate,
            endDate: endDate,
            mapids: mapids,
            scores: score,
            pos: pos,
            playerId: playerId,
        });

    },

    /**
     * 请求用户场次
     * @param clubId
     * @param score
     * @param startDate
     * @param endDate
     * @param mapids
     * @param pos
     * @param players
     * @param playerId
     */
    requestUesrChangCi: function (clubId, players, startDate, endDate, mapids, score, pos, playerId) {
        network.send(40001, {
            cmd: ClubRecordCode.UserChangCi,
            clubId: clubId,
            area: app.area,
            players: players,
            startDate: startDate,
            endDate: endDate,
            mapids: mapids,
            scores: score,
            pos: pos,
            playerId: playerId,
        });
    },

    /**
     * 查询战绩详情
     * @param map_id
     * @param player_id
     * @param mongo_id
     */
    requestRecordDetail: function (map_id, player_id, mongo_id) {
        network.send(40001, {
            cmd: ClubRecordCode.RecordDetail,
            area: app.area,
            map_id: map_id,
            player_id: player_id,
            mongo_id: mongo_id,
        });
    },

    /**
     * 查询亲友圈 群主剩余房卡
     * @param clubId
     */
    requestClubOwnerFangKa: function (clubId) {
        var clubInfo = ClubDataManager.getClubData(clubId);
        if (clubInfo) {
            network.send(40001, {
                cmd: ClubRecordCode.CardNum,
                area: app.area,
                uid: clubInfo['owner_uid'],
            });
        }
    },


    /**
     * 登录时提前请求 亲友圈数据
     */
    loginRequest: function () {
        clubMsgManager.loginReqeust = true;
        clubMsgManager.lockClubCodeCache();
        clubMsgManager.requestClubList(true);
    },
    /**
     * 根据返回的亲友圈列表 请求具体的亲友圈信息
     */
    loginRequestClubInfo: function () {
        ClubLastInfo = 'SelectClub_' + gameData.uid;
        var clubId = cc.sys.localStorage.getItem(ClubLastInfo) || 0;
        var clubList = ClubDataManager.getAllClubData();
        for (var i = 0; i < clubList.length; i++) {
            //判断玩家身上的亲友圈列表 是否有符合缓存的id
            if (clubId == clubList[i].id) {
                clubMsgManager.requestClubBaseInfo(clubId, true);
                clubMsgManager.requestListClubRoom(clubId, 0, 9999, undefined, true);
                clubMsgManager.requestClubMember(clubId, true);

                network.send(2103, {cmd: ClubMsgCode.UpdateLocal, club_id: clubId, location: 1});
                break;
            }
        }
    },

    loginReqeustMemberOffLine: function (clubId) {
        clubMsgManager.loginReqeust = false;
        clubMsgManager.requestOnLineMember(clubId);
    },
});